CXX = g++
# 添加 -O3 优化选项，提升性能，-Wall 开启常见警告
CXXFLAGS = -std=c++17 -I/usr/include/mysql -I/usr/include/jsoncpp -pthread -O3 -Wall 
LDFLAGS = -lmysqlclient -ljsoncpp

SRC = ConnectionPool.cpp MysqlConn.cpp test.cpp
OBJ = $(SRC:.cpp=.o)
TARGET = connectionPoolProject

all: $(TARGET)

$(TARGET): $(OBJ)
	$(CXX) -o $@ $^ $(LDFLAGS)

%.o: %.cpp
	$(CXX) $(CXXFLAGS) -c $< -o $@

clean:
	rm -f $(OBJ) $(TARGET)